

<template>
  <div class="form-view-row">
    <label>{{ field.displayName }}</label>
    <div class="form-view-row-content form-material-view">
      <el-button class="run-btn" type="plain-third" plain disabled>
        {{ $t('formSetting.jsCodeBlock.runText') }}
      </el-button>
    </div>
  </div>
</template>
<script>
export default {
  name: 'form-js-control-view',
  props: {
    field: {
      type: Object,
      default: () => ({})
    }
  },
  computed: {
    isHidden() {
      return this.field.setting?.hidden || false;
    }
  },
  mounted() {
    // 表单中隐藏该字段
    if(this.isHidden) {
      this.$el.style.display = 'none';
    }
  }
};
</script>
<style scoped lang="scss">
.run-btn {
  width: 80px;
  .el-icon-circle-close {
    color: $color-danger;
  }
}
</style>
